package com.comm.user.sql

class UserSql {
	public static def selectDaneo(){
		String strSql = '''
			select	'0' chk,
					seq,
			        daneo_nm,
					yeongmun_seolmyeong,
					hanja_seolmyeong,
					chulcheo,
					bunya
			  from  t_daneosajeon
			 where  1 = 0
			   and  daneo_nm like :daneoNm || '%'
		'''
		
		return strSql
	}
	
	public static def insertDaneo(){
		String strSql = '''
			insert into t_daneosajeon (
										seq, 
										daneo_nm, 
										yeongmun_seolmyeong,
										hanja_seolmyeong,
										chulcheo,
										bunya
									   )
			                   values (
			                   			(select max(nvl(seq,0))+1 from t_daneosajeon), 
			                   			:daneoNm, 
			                   			:yeongmunSeolmyeong,
			                   			:hanjaSeolmyeong,
			                   			:chulcheo,
			                   			:bunya
			                   		  )
		'''
		
		return strSql
	}
	
	public static def updateDaneo(){
		String strSql = '''
			update	t_daneosajeon
			   set  daneo_nm = :daneo_nm,
			        yeongmun_seolmyeong = :yeongmunSeolmyeong
			 where  1 = 1
			   and  seq = :seq
		'''
		
		return strSql
	}
	
	public static def deleteDaneo(){
		String strSql = '''
			delete from t_daneosajeon
			 where  1 = 1
			   and  seq = :seq
		'''
		
		return strSql
	}
	
	public static def selectDaneo = '''
			select	'0' chk,
					seq,
			        daneo_nm,
					yeongmun_seolmyeong,
					hanja_seolmyeong,
					chulcheo,
					bunya
			  from  t_daneosajeon
			 where  1 = 1
			   and  daneo_nm like :daneoNm || '%'
	'''
	
	public static def insertDaneo = '''
			insert into t_daneosajeon (
										seq, 
										daneo_nm, 
										yeongmun_seolmyeong,
										hanja_seolmyeong,
										chulcheo,
										bunya
									   )
			                   values (
			                   			(select max(nvl(seq,0))+1 from t_daneosajeon), 
			                   			:daneoNm, 
			                   			:yeongmunSeolmyeong,
			                   			:hanjaSeolmyeong,
			                   			:chulcheo,
			                   			:bunya
			                   		  )
	'''
	
	public static def updateDaneo = '''
			update	t_daneosajeon
			   set  daneo_nm = :daneo_nm,
			        yeongmun_seolmyeong = :yeongmunSeolmyeong
			 where  1 = 1
			   and  seq = :seq
	'''

	public static def deleteDaneo = '''
			delete from t_daneosajeon
			 where  1 = 1
			   and  seq = :seq
	'''
}
